<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>nnz</title>
  </head>
  <body bgcolor="#FFFFFF">
    <center>Scilab Function</center>
    <div align="right">Last update : January 1995</div>
    <p>
      <b>nnz</b> -   number of non zero entries in a matrix</p>
    <h3>
      <font color="blue">Calling Sequence</font>
    </h3>
    <dl>
      <dd>
        <tt>n=nnz(X)  </tt>
      </dd>
    </dl>
    <h3>
      <font color="blue">Parameters</font>
    </h3>
    <ul>
      <li>
        <tt>
          <b>X</b>
        </tt>: real or complex sparse (or full) matrix</li>
      <li>
        <tt>
          <b>n</b>
        </tt>: integer, the number of non zero elements in X</li>
    </ul>
    <h3>
      <font color="blue">Description</font>
    </h3>
    <p>
      <tt>
        <b>nnz</b>
      </tt> counts the number of non zero entries in a sparse or full matrix</p>
    <h3>
      <font color="blue">Examples</font>
    </h3>
    <pre>

sp=sparse([1,2;4,5;3,10],[1,2,3]);
nnz(sp)
a=[1 0 0 0 2];
nnz(a)
 
  </pre>
    <h3>
      <font color="blue">See Also</font>
    </h3>
    <p>
      <a href="spget.htm">
        <tt>
          <b>spget</b>
        </tt>
      </a>,&nbsp;&nbsp;</p>
  </body>
</html>
